﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.KaoQin
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.KaoQin;

    public class map_kqChuChai : EntityMapping<kqChuChai>
    {
        /// <summary>
        /// 出差
        /// </summary>
        public map_kqChuChai()
        {
            Property(x => x.ApprovalRecordId, map =>
            {
                map.Length(40);
            });

            Property(x => x.Days, map =>
            {

            });

            Property(x => x.bgnDate, map =>
            {

            });

            Property(x => x.endDate, map =>
            {

            });

            Property(x => x.Title, map =>
            {
                map.Length(200);
            });

            Property(x => x.Destination, map =>
            {
                map.Length(500000000);
            });

            Property(x => x.Content, map =>
            {
                map.Length(500000000);
            });

            Property(x => x.ProcessDescribe, map =>
            {
                map.Length(500000000);
            });

            Property(x => x.sqEndDate, map =>
            {
            });

            Property(x => x.sqEndFlag, map =>
            {
            });

            //申请人
            ManyToOne(x => x.sqUser, map =>
            {
                map.Column("UserID");
            });

            Bag(x => x.ccUsers, map =>
            {
                map.Table("ref_ChuChai_User");
                map.Key(keyMapper => keyMapper.Column("ChuChaiId"));
            }, act => act.ManyToMany(m => m.Column("UserId")));
        }
    }
}
